#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPushButton>
#include <QColorDialog>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QPushButton* btn = new QPushButton("颜色对话框",this);

    QColorDialog* cd = new QColorDialog(this);

    connect(btn,&QPushButton::clicked,[=]()
    {
        cd->setCurrentColor(QColor(100,100,100));
        cd->open();
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}

